/*
 * SerializePool.cpp
 *
 *  Created on: 13.11.2011
 *      Author: Pavel Sinay
 */

#include "SerializePool.h"

#include <iostream>

SerializePool::SerializePool() {
	m_ser_classes.push_back(new SerializableA());
	m_ser_classes.push_back(new SerializableB());
	m_ser_classes.push_back(new SerializableC());
	std::cout << "m_ser_classes.size() = "  << m_ser_classes.size() << std::endl;
}

SerializePool::~SerializePool() {
	std::vector<Serializable*>::iterator it = m_ser_classes.begin();
	for(; it != m_ser_classes.end(); ++it){
		delete *it;
	}
}

void SerializePool::deserialize(const std::string &data) {
	std::vector<Serializable*>::iterator it = m_ser_classes.begin();
	for(; it != m_ser_classes.end(); ++it){
		(*it)->deserialize(data);
		(*it)->execute(data);
	}
}

